<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>写⼀个 JS 函数，打印当前⻚⾯窗⼝的所有内容</title>
</head>

<body>
  后点击开始
  <div>
    <table>
      <tr>
        <td>我的打印的内容</td>
      </tr>
    </table>
  </div>
  <p>所有内容</p>
  <a onclick="arr()">打印</a>
  <script>
    function arr() {
      window.print();
    }
  </script>
</body>

</html>